<template>

    <el-form label-width="120px" label-position="left">

        <el-form-item label="商城名称">
            <el-input v-model="setting_data.config.shop_name"></el-input>
        </el-form-item>
        <el-form-item label="电话">
            <el-input v-model="setting_data.config.phone"></el-input>
        </el-form-item>
        <el-form-item label="QQ">
            <el-input v-model="setting_data.config.qq"></el-input>
        </el-form-item>

        <el-form-item label="微信">
            <el-input v-model="setting_data.config.wechat"></el-input>
        </el-form-item>

        <el-form-item label="默认客户组">
            <el-select v-model="setting_data.config.customer_group_id" placeholder="选择客户组">
                <el-option v-for="item in customer_group_list" :key="item.id" :label="item.name"
                    :value="item.id"></el-option>
            </el-select>
        </el-form-item>

        <el-form-item label="后台地址逆解析Key"  label-width="140px" >
            <el-input v-model="setting_data.config.latlng_to_addr_ley"></el-input>
        </el-form-item>

    </el-form>
</template>    

<script lang="ts" setup>
import { inject, ref } from 'vue';
import axios from 'axios';

const VITE_URL = window.VITE_URL;
// const settings = inject('settings')
const setting_data:any = inject('setting_data')

const customer_group_list:any = ref<Array<object>>([])




const get_customer_group_list = () => {

    const url = VITE_URL + '/admin.customerGroup/index'
    axios.get(url).then(res => {

        customer_group_list.value = res.data;
        customer_group_list.value.unshift({
            name: '无',
            id: 0
        })
    })

}
get_customer_group_list();

</script>